package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.pojo.AddRouteInfoReq;
import com.ruoyi.common.pojo.DeleteRouteInfoReq;
import com.ruoyi.common.pojo.QueryRouteListReq;
import com.ruoyi.system.service.SysRouteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "路径模块")
@RestController
@RequestMapping("/system/route")
public class SysRouteServiceController extends BaseController {

    @Autowired
    SysRouteService sysRouteService;

    @ApiOperation("获取路径列表")
    @PostMapping("/queryRouteList")
    public AjaxResult queryRouteList(@Validated @RequestBody QueryRouteListReq param) {
        return sysRouteService.queryRouteList(param);
    }

    @ApiOperation("添加路径")
    @PostMapping("/addRouteInfo")
    public AjaxResult addRouteInfo(@Validated @RequestBody AddRouteInfoReq param) {
        return sysRouteService.addRouteInfo(param);
    }

    @ApiOperation("删除路径列表")
    @PostMapping("/deleteRouteInfo")
    public AjaxResult deleteRouteInfo(@Validated @RequestBody DeleteRouteInfoReq param) {
        return sysRouteService.deleteRouteInfo(param);
    }
}
